<?xml version="1.0" encoding="iso-8859-1"?>

<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>Class: ActiveBackground::Configuration</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />

    <script language="JavaScript" type="text/javascript">
    // <![CDATA[

        function toggleSource( id )
        {
          var elem
          var link

          if( document.getElementById )
          {
            elem = document.getElementById( id )
            link = document.getElementById( "l_" + id )
          }
          else if ( document.all )
          {
            elem = eval( "document.all." + id )
            link = eval( "document.all.l_" + id )
          }
          else
            return false;

          if( elem.style.display == "block" )
          {
            elem.style.display = "none"
            link.innerHTML = "show source"
          }
          else
          {
            elem.style.display = "block"
            link.innerHTML = "hide source"
          }
        }

        function openCode( url )
        {
          window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
        }
      // ]]>
    </script>

  </head>

  <body>
  <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
  <td class="file-title"><span class="file-title-prefix">Class</span><br />ActiveBackground::Configuration</td>
  <td align="right">
    <table cellspacing=0 cellpadding=2>
      <tr valign="top">
        <td>In:</td>
        <td>

<a href="../../files/vendor/plugins/active_background/tasks/__/lib/active_background/configuration_rb.html">vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb</a>
        </td>
      </tr>
    <tr>
      <td>Parent:</td>
      <td>
Object
     </td>
   </tr>
         </table>
        </td>
        </tr>
      </table>
 <!-- banner header -->

  <div id="bodyContent">
      <div id="content">

  <div class="description"><p>
some methods to convert the keys from symbols to strings and back
again.&#8230; FIXME: Need to change the way configurations are processed
(not when setting but when done)
</p>
</div>



  <div class="sectiontitle">Methods</div>
  <ul>
  <li><a href="#M000037">access_control</a></li>
  <li><a href="#M000026">background</a></li>
  <li><a href="#M000027">background=</a></li>
  <li><a href="#M000034">database</a></li>
  <li><a href="#M000043">dump</a></li>
  <li><a href="#M000041">environment</a></li>
  <li><a href="#M000019">host</a></li>
  <li><a href="#M000020">host=</a></li>
  <li><a href="#M000017">init</a></li>
  <li><a href="#M000047">initialize_rails</a></li>
  <li><a href="#M000044">installed_as_rails_plugin?</a></li>
  <li><a href="#M000038">linux?</a></li>
  <li><a href="#M000046">load</a></li>
  <li><a href="#M000042">load</a></li>
  <li><a href="#M000050">load_action_pack</a></li>
  <li><a href="#M000049">load_active_record</a></li>
  <li><a href="#M000048">load_rails_config</a></li>
  <li><a href="#M000035">logger</a></li>
  <li><a href="#M000033">logging</a></li>
  <li><a href="#M000031">master</a></li>
  <li><a href="#M000021">port</a></li>
  <li><a href="#M000022">port=</a></li>
  <li><a href="#M000018">process</a></li>
  <li><a href="#M000036">rails</a></li>
  <li><a href="#M000040">root</a></li>
  <li><a href="#M000030">server</a></li>
  <li><a href="#M000025">server=</a></li>
  <li><a href="#M000023">server_name</a></li>
  <li><a href="#M000024">server_name=</a></li>
  <li><a href="#M000045">setup</a></li>
  <li><a href="#M000032">slave</a></li>
  <li><a href="#M000028">sleep</a></li>
  <li><a href="#M000029">sleep=</a></li>
  <li><a href="#M000039">windows?</a></li>
  </ul>


<div class="sectiontitle">Included Modules</div>
<ul>
  <li>Singleton</li>
</ul>




  <div class="sectiontitle">Attributes</div>
  <table border='0' cellpadding='5'>

  <tr valign='top'>
    <td class='attr-rw'>
[RW]
    </td>
    <td class='attr-name'>environment</td>
    <td class='attr-desc'></td>
  </tr>
  </table>


<div class="sectiontitle">Public Instance methods</div>
<div class="method">
  <div class="title">
    <a name="M000037"></a><b>access_control</b>() {|@access_control| ...}
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000037_source')" id="l_M000037_source">show source</a> ]</p>

  <div id="M000037_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 127</span>
127:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">access_control</span>
128:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
129:         <span class="ruby-keyword kw">yield</span> <span class="ruby-ivar">@access_control</span>
130:       <span class="ruby-keyword kw">else</span>
131:         <span class="ruby-ivar">@access_control</span>
132:       <span class="ruby-keyword kw">end</span>
133:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000026"></a><b>background</b>(background=nil)
  </div>
<div class="aka">
  This method is also aliased as
  <a href="Configuration.html#M000027">background=</a>
</div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000026_source')" id="l_M000026_source">show source</a> ]</p>

  <div id="M000026_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 57</span>
57:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">background</span>(<span class="ruby-identifier">background</span>=<span class="ruby-keyword kw">nil</span>)
58:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">background</span>
59:         <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">:master</span>].<span class="ruby-identifier">background</span>=<span class="ruby-identifier">background</span>
60:       <span class="ruby-keyword kw">else</span>
61:         <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">:master</span>].<span class="ruby-identifier">background</span>
62:       <span class="ruby-keyword kw">end</span>
63:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000027"></a><b>background=</b>(background=nil)
  </div>
  <div class="description">

  <p>
Alias for <a href="Configuration.html#M000026">background</a>
</p>
  </div>
</div>
<div class="method">
  <div class="title">
    <a name="M000034"></a><b>database</b>() {|@database| ...}
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000034_source')" id="l_M000034_source">show source</a> ]</p>

  <div id="M000034_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 107</span>
107:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">database</span>
108:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
109:         <span class="ruby-keyword kw">yield</span> <span class="ruby-ivar">@database</span>
110:       <span class="ruby-keyword kw">else</span>
111:         <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@database</span>
112:       <span class="ruby-keyword kw">end</span>
113:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000043"></a><b>dump</b>(config)
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000043_source')" id="l_M000043_source">show source</a> ]</p>

  <div id="M000043_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 170</span>
170:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dump</span>(<span class="ruby-identifier">config</span>)
171:       <span class="ruby-identifier">config</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
172:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
173:           <span class="ruby-identifier">config</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>] = <span class="ruby-identifier">value</span>
174:           <span class="ruby-identifier">config</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>)
175:         <span class="ruby-keyword kw">end</span>
176:       <span class="ruby-keyword kw">end</span>
177:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000041"></a><b>environment</b>()
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000041_source')" id="l_M000041_source">show source</a> ]</p>

  <div id="M000041_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 155</span>
155:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">environment</span>
156:       <span class="ruby-ivar">@environment</span>.<span class="ruby-identifier">to_s</span>
157:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000019"></a><b>host</b>(host=nil)
  </div>
<div class="aka">
  This method is also aliased as
  <a href="Configuration.html#M000020">host=</a>
</div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000019_source')" id="l_M000019_source">show source</a> ]</p>

  <div id="M000019_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 29</span>
29:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">host</span>(<span class="ruby-identifier">host</span>=<span class="ruby-keyword kw">nil</span>)
30:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">host</span>
31:         <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">:master</span>].<span class="ruby-identifier">host</span>=<span class="ruby-identifier">host</span>
32:       <span class="ruby-keyword kw">else</span>
33:         <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">:master</span>].<span class="ruby-identifier">host</span>
34:       <span class="ruby-keyword kw">end</span>
35:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000020"></a><b>host=</b>(host=nil)
  </div>
  <div class="description">

  <p>
Alias for <a href="Configuration.html#M000019">host</a>
</p>
  </div>
</div>
<div class="method">
  <div class="title">
    <a name="M000017"></a><b>init</b>()
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000017_source')" id="l_M000017_source">show source</a> ]</p>

  <div id="M000017_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 11</span>
11:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init</span>
12:       <span class="ruby-ivar">@server</span>=<span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
13:       <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">:master</span>]=<span class="ruby-constant">ServerConfig</span>.<span class="ruby-identifier">new</span>
14:       <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">:master</span>].<span class="ruby-identifier">name</span>=<span class="ruby-identifier">:master</span>
15:       <span class="ruby-ivar">@database</span>=<span class="ruby-constant">DatabaseConfig</span>.<span class="ruby-identifier">new</span>
16:       <span class="ruby-ivar">@rails</span>=<span class="ruby-constant">RailsConfig</span>.<span class="ruby-identifier">new</span>
17:       <span class="ruby-ivar">@access_control</span>=<span class="ruby-constant">AccessControlConfig</span>.<span class="ruby-identifier">new</span>
18:       <span class="ruby-ivar">@environment</span>=<span class="ruby-identifier">:production</span>
19:             
20:       <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">abort_on_exception</span>=<span class="ruby-keyword kw">true</span>
21:       <span class="ruby-identifier">$ACTIVE_BACKGROUND_DEBUG</span> = <span class="ruby-keyword kw">true</span>
22:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000047"></a><b>initialize_rails</b>(level = :boot)
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000047_source')" id="l_M000047_source">show source</a> ]</p>

  <div id="M000047_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 237</span>
237:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize_rails</span>(<span class="ruby-identifier">level</span> = <span class="ruby-identifier">:boot</span>)
238:       <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">level</span>
239:         <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:boot</span>
240:           <span class="ruby-identifier">load_rails_config</span>
241:         <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:active_record</span>
242:           <span class="ruby-identifier">load_rails_config</span>
243:           <span class="ruby-identifier">load_active_record</span>
244:         <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:all</span>
245:           <span class="ruby-identifier">load_rails_config</span>
246:           <span class="ruby-identifier">load_active_record</span>
247:           <span class="ruby-identifier">load_action_pack</span>
248:       <span class="ruby-keyword kw">end</span>
249:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000044"></a><b>installed_as_rails_plugin?</b>()
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000044_source')" id="l_M000044_source">show source</a> ]</p>

  <div id="M000044_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 179</span>
179:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">installed_as_rails_plugin?</span>
180:       <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;/../../../../config/boot.rb&quot;</span>)
181:         <span class="ruby-keyword kw">true</span>
182:       <span class="ruby-keyword kw">else</span>
183:         <span class="ruby-keyword kw">false</span>
184:       <span class="ruby-keyword kw">end</span>
185:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000038"></a><b>linux?</b>()
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000038_source')" id="l_M000038_source">show source</a> ]</p>

  <div id="M000038_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 135</span>
135:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">linux?</span>
136:       <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">defined</span>(<span class="ruby-identifier">__human68k__</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">defined</span>(<span class="ruby-identifier">_WIN32</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">defined</span>(<span class="ruby-identifier">__MACOS__</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">defined</span>(<span class="ruby-identifier">__EMX__</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">defined</span>(<span class="ruby-identifier">__VMS</span>)
137:         <span class="ruby-keyword kw">true</span>
138:       <span class="ruby-keyword kw">else</span>
139:         <span class="ruby-keyword kw">false</span>
140:       <span class="ruby-keyword kw">end</span>
141:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000046"></a><b>load</b>()
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000046_source')" id="l_M000046_source">show source</a> ]</p>

  <div id="M000046_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 218</span>
218:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load</span>
219:       <span class="ruby-identifier">server</span> = <span class="ruby-constant">Server</span>.<span class="ruby-identifier">new</span>
220:       <span class="ruby-identifier">config</span> = <span class="ruby-constant">Configuration</span>.<span class="ruby-identifier">instance</span>
221:       <span class="ruby-identifier">options</span> = <span class="ruby-identifier">server</span>.<span class="ruby-identifier">defaults</span>
222:       
223:       <span class="ruby-keyword kw">begin</span>
224:         <span class="ruby-keyword kw">begin</span> <span class="ruby-comment cmt"># try to load rails</span>
225:           <span class="ruby-identifier">require</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;/../../../../config/boot.rb&quot;</span>
226:           <span class="ruby-identifier">options</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">config</span>.<span class="ruby-identifier">load</span>(<span class="ruby-node">&quot;#{RAILS_ROOT}/config/#{options[:config_file]}&quot;</span>))
227:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span> <span class="ruby-comment cmt"># loading of rails failed</span>
228:           <span class="ruby-identifier">options</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">config</span>.<span class="ruby-identifier">load</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>) <span class="ruby-operator">+</span> <span class="ruby-node">&quot;/../config/#{options[:config_file]}&quot;</span>))
229:         <span class="ruby-keyword kw">end</span>
230:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span> <span class="ruby-comment cmt"># loading of local file failed</span>
231:         <span class="ruby-identifier">options</span> = <span class="ruby-identifier">options</span>
232:       <span class="ruby-keyword kw">end</span>
233: 
234:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">options</span>
235:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000042"></a><b>load</b>(file)
  </div>
  <div class="description">

  <p>
OLD METHODS, NEED TO CLEAN THEM UP &#8230;
</p>
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000042_source')" id="l_M000042_source">show source</a> ]</p>

  <div id="M000042_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 160</span>
160:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load</span>(<span class="ruby-identifier">file</span>)
161:       <span class="ruby-identifier">config</span> = <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load_file</span>(<span class="ruby-identifier">file</span>)
162:       <span class="ruby-identifier">config</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
163:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>)
164:           <span class="ruby-identifier">config</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_sym</span>] = <span class="ruby-identifier">value</span>
165:           <span class="ruby-identifier">config</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>)
166:         <span class="ruby-keyword kw">end</span>
167:       <span class="ruby-keyword kw">end</span>
168:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000035"></a><b>logger</b>()
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000035_source')" id="l_M000035_source">show source</a> ]</p>

  <div id="M000035_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 115</span>
115:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logger</span>
116:       <span class="ruby-ivar">@logger</span>
117:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000033"></a><b>logging</b>(logdev, shift_age = 0, shift_size = 1048576) {|@logger| ...}
  </div>
  <div class="description">

  <p>
logging
</p>
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000033_source')" id="l_M000033_source">show source</a> ]</p>

  <div id="M000033_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 98</span>
 98:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logging</span>(<span class="ruby-identifier">logdev</span>, <span class="ruby-identifier">shift_age</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">shift_size</span> = <span class="ruby-value">1048576</span>)
 99:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
100:         <span class="ruby-ivar">@logger</span> = <span class="ruby-constant">Logger</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">logdev</span>, <span class="ruby-identifier">shift_age</span>, <span class="ruby-identifier">shift_size</span>)
101:         <span class="ruby-keyword kw">yield</span> <span class="ruby-ivar">@logger</span>
102:       <span class="ruby-keyword kw">else</span>
103:         <span class="ruby-ivar">@logger</span>
104:       <span class="ruby-keyword kw">end</span>
105:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000031"></a><b>master</b>(server_name)
  </div>
  <div class="description">

  <p>
Alias for <a href="Configuration.html#M000030">server</a>
</p>
  </div>
</div>
<div class="method">
  <div class="title">
    <a name="M000021"></a><b>port</b>(port=nil)
  </div>
<div class="aka">
  This method is also aliased as
  <a href="Configuration.html#M000022">port=</a>
</div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000021_source')" id="l_M000021_source">show source</a> ]</p>

  <div id="M000021_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 38</span>
38:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">port</span>(<span class="ruby-identifier">port</span>=<span class="ruby-keyword kw">nil</span>)
39:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">port</span>
40:         <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">:master</span>].<span class="ruby-identifier">port</span>=<span class="ruby-identifier">port</span>
41:       <span class="ruby-keyword kw">else</span>
42:         <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">:master</span>].<span class="ruby-identifier">port</span>
43:       <span class="ruby-keyword kw">end</span>
44:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000022"></a><b>port=</b>(port=nil)
  </div>
  <div class="description">

  <p>
Alias for <a href="Configuration.html#M000021">port</a>
</p>
  </div>
</div>
<div class="method">
  <div class="title">
    <a name="M000018"></a><b>process</b>()
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000018_source')" id="l_M000018_source">show source</a> ]</p>

  <div id="M000018_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 24</span>
24:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process</span>
25:       <span class="ruby-ivar">@rails</span>.<span class="ruby-identifier">process</span>
26:       <span class="ruby-ivar">@database</span>.<span class="ruby-identifier">process</span>
27:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000036"></a><b>rails</b>() {|@rails| ...}
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000036_source')" id="l_M000036_source">show source</a> ]</p>

  <div id="M000036_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 119</span>
119:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rails</span>
120:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
121:         <span class="ruby-keyword kw">yield</span> <span class="ruby-ivar">@rails</span>
122:       <span class="ruby-keyword kw">else</span>
123:         <span class="ruby-ivar">@rails</span>
124:       <span class="ruby-keyword kw">end</span>
125:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000040"></a><b>root</b>()
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000040_source')" id="l_M000040_source">show source</a> ]</p>

  <div id="M000040_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 151</span>
151:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">root</span>
152:       <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;/../../&quot;</span>)
153:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000030"></a><b>server</b>(server_name) {|@server[server_name]| ...}
  </div>
<div class="aka">
  This method is also aliased as
  <a href="Configuration.html#M000031">master</a>
</div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000030_source')" id="l_M000030_source">show source</a> ]</p>

  <div id="M000030_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 75</span>
75:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">server</span>(<span class="ruby-identifier">server_name</span>)
76:       <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">server_name</span>]=<span class="ruby-constant">ServerConfig</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">server_name</span>]
77:       <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">server_name</span>].<span class="ruby-identifier">name</span>=<span class="ruby-identifier">server_name</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">server_name</span>]
78:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
79:         <span class="ruby-keyword kw">yield</span> <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">server_name</span>]
80:       <span class="ruby-keyword kw">else</span>
81:         <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">server_name</span>]
82:       <span class="ruby-keyword kw">end</span>
83:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000025"></a><b>server=</b>(server_name=nil)
  </div>
  <div class="description">

  <p>
Alias for <a href="Configuration.html#M000023">server_name</a>
</p>
  </div>
</div>
<div class="method">
  <div class="title">
    <a name="M000023"></a><b>server_name</b>(server_name=nil)
  </div>
<div class="aka">
  This method is also aliased as
  <a href="Configuration.html#M000024">server_name=</a>
  <a href="Configuration.html#M000025">server=</a>
</div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000023_source')" id="l_M000023_source">show source</a> ]</p>

  <div id="M000023_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 47</span>
47:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">server_name</span>(<span class="ruby-identifier">server_name</span>=<span class="ruby-keyword kw">nil</span>)
48:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">server_name</span>
49:         <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">:master</span>].<span class="ruby-identifier">server_name</span>=<span class="ruby-identifier">server_name</span>
50:       <span class="ruby-keyword kw">else</span>
51:         <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">:master</span>].<span class="ruby-identifier">server_name</span>
52:       <span class="ruby-keyword kw">end</span>
53:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000024"></a><b>server_name=</b>(server_name=nil)
  </div>
  <div class="description">

  <p>
Alias for <a href="Configuration.html#M000023">server_name</a>
</p>
  </div>
</div>
<div class="method">
  <div class="title">
    <a name="M000045"></a><b>setup</b>(service = &quot;Base&quot;)
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000045_source')" id="l_M000045_source">show source</a> ]</p>

  <div id="M000045_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 187</span>
187:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>(<span class="ruby-identifier">service</span> = <span class="ruby-value str">&quot;Base&quot;</span>)
188:       <span class="ruby-identifier">server</span> = <span class="ruby-constant">Server</span>.<span class="ruby-identifier">new</span>
189:       <span class="ruby-identifier">config</span> = <span class="ruby-constant">Configuration</span>.<span class="ruby-identifier">instance</span>
190:       <span class="ruby-identifier">options</span> = <span class="ruby-identifier">server</span>.<span class="ruby-identifier">defaults</span>
191:       <span class="ruby-identifier">config_file</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:config_file</span>]
192:       <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:service</span>] = <span class="ruby-identifier">service</span>
193:       <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:config_file</span>)
194:       
195:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">installed_as_rails_plugin?</span>
196:         <span class="ruby-identifier">config</span>.<span class="ruby-identifier">initialize_rails</span>(<span class="ruby-identifier">:boot</span>)
197:         <span class="ruby-identifier">root</span> = <span class="ruby-constant">RAILS_ROOT</span>
198:       <span class="ruby-keyword kw">else</span>
199:         <span class="ruby-identifier">root</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;/../..&quot;</span>
200:       <span class="ruby-keyword kw">end</span>
201:       
202:       <span class="ruby-keyword kw">begin</span>
203:         <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">root</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;/config/#{config_file}&quot;</span>)
204:           <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">root</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;/config/#{config_file}&quot;</span>, <span class="ruby-value str">&quot;w+&quot;</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">config</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">options</span>), <span class="ruby-identifier">f</span>)}
205:         <span class="ruby-keyword kw">else</span>
206:           <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load_file</span>(<span class="ruby-identifier">root</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;/config/#{config_file}&quot;</span>)
207:             <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">root</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;/config/#{config_file}&quot;</span>, <span class="ruby-value str">&quot;w+&quot;</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">config</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">options</span>), <span class="ruby-identifier">f</span>)}
208:           <span class="ruby-keyword kw">else</span>
209:             <span class="ruby-identifier">tmp_options</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">config</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">root</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;/config/#{config_file}&quot;</span>))
210:             <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">root</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;/config/#{config_file}&quot;</span>, <span class="ruby-value str">&quot;w+&quot;</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">config</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">tmp_options</span>), <span class="ruby-identifier">f</span>)}
211:           <span class="ruby-keyword kw">end</span>
212:         <span class="ruby-keyword kw">end</span>
213:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
214:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">'setup failed '</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>
215:       <span class="ruby-keyword kw">end</span>
216:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000032"></a><b>slave</b>(server_name) {|@server[server_name]| ...}
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000032_source')" id="l_M000032_source">show source</a> ]</p>

  <div id="M000032_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 86</span>
86:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">slave</span>(<span class="ruby-identifier">server_name</span>)
87:       <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">server_name</span>]=<span class="ruby-constant">ServerConfig</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">server_name</span>]
88:       <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">server_name</span>].<span class="ruby-identifier">name</span>=<span class="ruby-identifier">server_name</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">server_name</span>]
89:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
90:         <span class="ruby-keyword kw">yield</span> <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">server_name</span>]
91:       <span class="ruby-keyword kw">else</span>
92:         <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">server_name</span>]
93:       <span class="ruby-keyword kw">end</span>
94:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000028"></a><b>sleep</b>(sleep=nil)
  </div>
<div class="aka">
  This method is also aliased as
  <a href="Configuration.html#M000029">sleep=</a>
</div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000028_source')" id="l_M000028_source">show source</a> ]</p>

  <div id="M000028_source" class="dyn-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 66</span>
66:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sleep</span>(<span class="ruby-identifier">sleep</span>=<span class="ruby-keyword kw">nil</span>)
67:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sleep</span>
68:         <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">:master</span>].<span class="ruby-identifier">sleep</span>=<span class="ruby-identifier">sleep</span>
69:       <span class="ruby-keyword kw">else</span>
70:         <span class="ruby-ivar">@server</span>[<span class="ruby-identifier">:master</span>].<span class="ruby-identifier">sleep</span>
71:       <span class="ruby-keyword kw">end</span>
72:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000029"></a><b>sleep=</b>(sleep=nil)
  </div>
  <div class="description">

  <p>
Alias for <a href="Configuration.html#M000028">sleep</a>
</p>
  </div>
</div>
<div class="method">
  <div class="title">
    <a name="M000039"></a><b>windows?</b>()
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000039_source')" id="l_M000039_source">show source</a> ]</p>

  <div id="M000039_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 143</span>
143:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">windows?</span>
144:       <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">defined</span>(<span class="ruby-identifier">__human68k__</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">defined</span>(<span class="ruby-identifier">_WIN32</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">defined</span>(<span class="ruby-identifier">__MACOS__</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">defined</span>(<span class="ruby-identifier">__EMX__</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">defined</span>(<span class="ruby-identifier">__VMS</span>)
145:         <span class="ruby-keyword kw">false</span>
146:       <span class="ruby-keyword kw">else</span>
147:         <span class="ruby-keyword kw">true</span>
148:       <span class="ruby-keyword kw">end</span>
149:     <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>

<div class="sectiontitle">Private Instance methods</div>
<div class="method">
  <div class="title">
    <a name="M000050"></a><b>load_action_pack</b>()
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000050_source')" id="l_M000050_source">show source</a> ]</p>

  <div id="M000050_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 268</span>
268:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_action_pack</span>
269:         
270:       <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000049"></a><b>load_active_record</b>()
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000049_source')" id="l_M000049_source">show source</a> ]</p>

  <div id="M000049_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 264</span>
264:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_active_record</span>
265:         
266:       <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
<div class="method">
  <div class="title">
    <a name="M000048"></a><b>load_rails_config</b>()
  </div>
<div class="sourcecode">
  <p class="source-link">[ <a href="javascript:toggleSource('M000048_source')" id="l_M000048_source">show source</a> ]</p>

  <div id="M000048_source" class="dyn-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_background/tasks/../lib/active_background/configuration.rb, line 252</span>
252:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_rails_config</span>
253:         <span class="ruby-keyword kw">begin</span>
254:           <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;/../../../../config/boot.rb&quot;</span>)
255:             <span class="ruby-identifier">require</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;/../../../../config/boot.rb&quot;</span>
256:           <span class="ruby-keyword kw">else</span>
257:             <span class="ruby-identifier">raise</span> <span class="ruby-value str">'rails distribution not found or not installed as plugin'</span>
258:           <span class="ruby-keyword kw">end</span>
259:         <span class="ruby-keyword kw">rescue</span>
260:           <span class="ruby-comment cmt"># log something</span>
261:         <span class="ruby-keyword kw">end</span>
262:       <span class="ruby-keyword kw">end</span>
</pre>
  </div>
</div>
</div>
</div>

  </div>

    </body>
</html>